package kr.ac.chungbuk;

import java.text.DateFormat;
import java.util.Date;
import java.util.Locale;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * Handles requests for the application home page.
 */
@Controller
public class HomeController {
	
	private static final Logger logger = LoggerFactory.getLogger(HomeController.class);
	
	/**
	 * Simply selects the home view to render by returning its name.
	 */
	@RequestMapping(value = "/", method = RequestMethod.GET)
	public String home(Locale locale, Model model) {
		logger.info("Welcome home! The client locale is {}.", locale);
		
		Date date = new Date();
		DateFormat dateFormat = DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG, locale);
		
		String formattedDate = dateFormat.format(date);
		
		model.addAttribute("serverTime", formattedDate );
		
		return "home";
	}
	@RequestMapping("jquery13")
	public String jquery13(){
		return "jquery13";
	}
	@RequestMapping("index")
	public String index(){
		return "index";
	}
	@RequestMapping("index1")
	public String index1(){
		return "index1";
	}
	@RequestMapping("index2")
	public String index2(){
		return "index2";
	}
	@RequestMapping("index3")
	public String index3(){
		return "index3";
	}
	@RequestMapping("date")
	public String date(){
		return "date";
	}
	@RequestMapping("prog")
	public String prog(){
		return "prog";
	}
	@RequestMapping("prog2")
	public String prog2(){
		return "prog2";
	}
	@RequestMapping("cbnu")
	public String cbnu(){
		return "cbnu";
	}
	@RequestMapping("cbnu21")
	public String cbnu21(){
		return "cbnu21";
	}
	@RequestMapping("cbnu22")
	public String cbnu22(){
		return "cbnu22";
	}
	@RequestMapping("cbnu23")
	public String cbnu23(){
		return "cbnu23";
	}
	@RequestMapping("cbnu24")
	public String cbnu24(){
		return "cbnu24";
	}
	@RequestMapping("cbnu29")
	public String cbnu29(){
		return "cbnu29";
	}
	@RequestMapping("cbnu12")
	public String cbnu12(){
		return "cbnu12";
	}
}
